/**
 * 
 */
package org.carabiner.infinitest.swingui;

import java.awt.Color;

import javax.swing.Icon;
import javax.swing.tree.DefaultMutableTreeNode;

import org.carabiner.infinitest.TestEvent;

/**
 * 
 * @author <a href="mailto:benrady@gmail.com"Ben Rady</a>
 */
class TestTreeNode extends DefaultMutableTreeNode implements InfinitestTreeNode
{
  public TestTreeNode(TestEvent testEvent)
  {
    super(testEvent);
    setAllowsChildren(true);
  }

  public void updateNode(TestEvent e)
  {
    setUserObject(e);
  }

  public TestEvent getTestEvent()
  {
    return (TestEvent) getUserObject();
  }

  public boolean isNodeForEvent(TestEvent e)
  {
    return e.getTestName().equals(getTestEvent().getTestName());
  }

  public String toString()
  {
    return getTestEvent().getTestName();
  }

  public String getToolTip()
  {
    return null;
  }

  public Icon getIcon()
  {
    return null;
  }

  public Color getColor()
  {
    return null;
  }
}